#ifndef SOCKETCLIENT_H
#define SOCKETCLIENT_H

#include <hpsocket/HPSocket.h>
#include <qobject.h>
#include <string>

class SocketClient
        : public QObject
        , public CTcpClientListener
{
    Q_OBJECT;
public:
    virtual EnHandleResult OnPrepareConnect(ITcpClient* pSender, CONNID dwConnID, SOCKET socket);
    virtual EnHandleResult OnConnect(ITcpClient* pSender, CONNID dwConnID);
    virtual EnHandleResult OnReceive(ITcpClient* pSender, CONNID dwConnID, const BYTE* pData, int iLength);
    virtual EnHandleResult OnClose(ITcpClient* pSender, CONNID dwConnID, EnSocketOperation enOperation, int iErrorCode);

signals:
    void recvMsg(QByteArray msg_);
    void clientPrepared();
    void clientConnected();
    void clientClosed();
};

#endif // SOCKETCLIENT_H
